//
//  ViewOfLogIn.m
//  王宇先_07_登录界面_navigation
//
//  Created by wyx on 16/3/17.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "ViewOfLogIn.h"
#import "RootNavigationControllerViewController.h"


@interface ViewOfLogIn ()

@end

@implementation ViewOfLogIn

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor lightGrayColor];
    [self configForNavigationItemLogIn];
    UITextField *name = [[UITextField alloc] initWithFrame:CGRectMake(40, 100, self.view.frame.size.width - 80, 40)];
    name.placeholder = @"请输入用户名";
    name.borderStyle = 3;
    [self.view addSubview:name];
    [name release];
    UITextField *key = [[UITextField alloc] initWithFrame:CGRectMake(40, 160, self.view.frame.size.width - 80, 40)];
    key.placeholder = @"请输入密码";
    key.borderStyle = 3;
    [self.view addSubview:key];
    [key release];
    UITextField *keyEnter = [[UITextField alloc] initWithFrame:CGRectMake(40, 220, self.view.frame.size.width - 80, 40)];
    keyEnter.placeholder = @"请确认密码";
    keyEnter.borderStyle = 3;
    [self.view addSubview:keyEnter];
    [keyEnter release];
    UIButton *login = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2 - 20, 280, 40, 40)];
    [login setTitle:@"登录" forState:UIControlStateNormal];
    [self.view addSubview:login];
    [login release];
    
}
- (void)configForNavigationItemLogIn{
     
    //中间title
    self.navigationItem.title = @"注册";
    //左边( leftBarButtonItem)
    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(handleCancle:)]autorelease];
}
- (void)handleCancle:(UIBarButtonItem *)canale {
    [self dismissViewControllerAnimated:YES completion:^{
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
